package com.stormrage.edu.serv.learn.impl;

import java.util.HashMap;
import java.util.Map;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.stormrage.edu.dao.learn.LeaTermDao;
import com.stormrage.edu.serv.learn.LeaTermServ;
import com.stormrage.entity.learn.LeaTerm;
import com.stormragetech.core.exception.StormrageTechException;

/**
 * @Title: LeaTermServImpl.java
 * @Package com.stormrage.edu.serv.learn.impl
 * @Description: 学期 Service
 * @author www.stormragetech.com
 * @date 2016年4月17日
 * @version V1.0
 */
@Service
public class LeaTermServImpl implements LeaTermServ {

	private static final Logger logger = LoggerFactory.getLogger(LeaTermServImpl.class);

	@Autowired
	private LeaTermDao leaTermDao;

	@Override
	public LeaTerm queryById(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryById 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		LeaTerm entity = leaTermDao.queryById(map);

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryById 】-【 COMPLETED 】");
		return entity;

	}

	@Override
	public LeaTerm queryByIdStudy(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryById 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("id", arg0);

		LeaTerm entity = leaTermDao.queryByIdStudy(map);

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryById 】-【 COMPLETED 】");
		return entity;

	}

	@Override
	public LeaTerm queryByMajorId(Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryByMajorId 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("majorId", arg0);

		LeaTerm entity = leaTermDao.queryByMajorId(map);

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryByMajorId 】-【 COMPLETED 】");
		return entity;

	}

	@Override
	public LeaTerm queryForMajor(final Integer arg0) throws StormrageTechException {

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryForMajor 】-【 STARTED 】");

		Map<String, Object> map = new HashMap<String, Object>();
		map.put("majorId", arg0);

		LeaTerm entity = leaTermDao.queryForMajor(map);

		logger.debug(" 【 Serv 】- 【 LeaTermServ 】- 【 QueryForMajor 】-【 COMPLETED 】");
		return entity;

	}

}
